package com.arpa.wms.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * <p>
 * 库位
 * </p>
 *
 * @author LEO
 * @since 2020-08-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value = "Location对象", description = "库位")
@TableName("wms_location")
public class Location extends BasicEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "数据标识")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "所属机构")
    @TableField("group_code")
    private String groupCode;

    @ApiModelProperty(value = "库位名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "编码")
    @TableField("serial_number")
    @Length(max = 100, message = "编码长度不能大于100个字符", groups = {Save.class, Update.class})
    private String serialNumber;

    @ApiModelProperty(value = "编码")
    @TableField("full_serial_number")
    @Length(max = 200, message = "编码长度不能大于200个字符", groups = {Save.class, Update.class})
    private String fullSerialNumber;

    @ApiModelProperty(value = "所属仓库")
    @TableField("warehouse_code")
    private String warehouseCode;

    @ApiModelProperty(value = "所属库区")
    @TableField("space_code")
    private String spaceCode;

    @ApiModelProperty(value = "库位类型 0拣货，1存货，2集货")
    @TableField("location_type")
    private String locationType;

    @ApiModelProperty(value = "库位承载类型")
    @TableField("bear_type")
    private String bearType;

    @ApiModelProperty(value = "上架动线号")
    @TableField("shelves_number")
    @Min(value = 1, message = "上架动线号不能小于1", groups = {Save.class, Update.class})
    @Max(value = 2147483647, message = "上架动线号不能大于2147483647",groups = {Save.class, Update.class})
    private Integer shelvesNumber;

    @ApiModelProperty(value = "拣货动线号")
    @TableField("pick_number")
    @Min(value = 1, message = "拣货动线号不能小于1", groups = {Save.class, Update.class})
    @Max(value = 2147483647, message = "拣货动线号不能大于2147483647", groups = {Save.class, Update.class})
    private Integer pickNumber;

    @ApiModelProperty(value = "盘点动线号")
    @TableField("inventory_number")
    @Min(value = 1, message = "盘点动线号不能小于1", groups = {Save.class, Update.class})
    @Max(value = 2147483647, message = "盘点动线号不能大于2147483647", groups = {Save.class, Update.class})
    private Integer inventoryNumber;

    @ApiModelProperty(value = "混放策略 0:商品混放，1：批次混放，2：混放，3：不混放")
    @TableField("storage_strategy")
    private String storageStrategy;

    @ApiModelProperty(value = "出入库锁: 0:入库锁,1:出库锁,2:全锁,3:不锁")
    @TableField("io_lock")
    private String ioLock;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    @Length(max = 100, message = "备注长度不能大于100个字符", groups = {Save.class, Update.class})
    private String remarks;

    @ApiModelProperty(value = "状态")
    @TableField("status")
    private String status;

    @ApiModelProperty(value = "是否可删除操作 0-不可删除 1-可删除")
    @TableField("delete_flag")
    private String deleteFlag;

    @ApiModelProperty(value = "是否临时库位;0:非临时库位；1：临时库位")
    @TableField("is_temp_location")
    private Integer tempLocation;

    @ApiModelProperty(value = "动碰次数")
    @TableField("action_num")
    private Integer actionNum;

    @ApiModelProperty(value = "库位是否占用;0:未被占用；1：已占用")
    @TableField("is_occupy")
    private Integer occupy;


    @ApiModelProperty(value = "仓库名称")
    @TableField(exist = false)
    private String warehouseName;

    @ApiModelProperty(value = "库区名称")
    @TableField(exist = false)
    private String warehouseSpaceName;

    public interface Save {

    }

    public interface Update {

    }
}
